package org.ly817.falsework.cloud.admin.biz;


import org.ly817.falsework.cloud.admin.mapper.UserMapper;
import org.ly817.falsework.cloud.admin.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author LuoYu
 * @date 2018/09/16 10:28
 * <p>
 * Description:
 * 用户业务逻辑
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class UserBiz {
    @Autowired
    private UserMapper userMapper;

    public UserMapper getUserMapper() {
        return userMapper;
    }

    public User getUserByUsername(String username){
        return userMapper.selectOne(new User(username));
    }

    public User getUserById(Long id){
        return userMapper.selectOne(new User(id));
    }
}
